/*
 *  开工标准化 单字段维护
 *  初始化基础字段 formItems
 *  其他修改根据项目Id配置 (formItems+'项目Id),配置一份
 * */

const object = {
    // 铁科院
    formItems: [
        {
            name: "reportNo",
            type: "input",
            label: "编号：",
            required: true,
        },
        {
            name: "parentProjName",
            type: "input",
            label: "项目名称：",
            typeIds: [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], // 开工标准化36-37-38-39-40-41-42-43-44-45-46
        },
        {
            name: "projTypeName",
            type: "select",
            isConfigLabel: true,
            label: "",
            labelDef: "开工标准化评估类型：", // 默认值
            required: true,
            typeIds: [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], // 开工标准化36-37-38-39-40-41-42-43-44-45-46

            props: {
                optionsName: "options", //option字段
                changeFunc: "projTypeIdChange", //回调
                changeField: "projTypeId",
            },
        },
        {
            name: "projName",
            type: "select",
            label: "标段：",
            props: {
                type: "selectPact",
                changeFunc: "selectPact",
                changeField: "projId",
            },
        },
        {
            name: "cellName",
            type: "input",
            isConfigLabel: true,
            typeIds: [38, 39, 40, 41, 42, 43, 44, 45, 46], // 开工标准化36-37-38-39-40-41-42-43-44-45-46
            label: "",
            labelDef: "单位工程：", // 默认值
        },
        {
            name: "respUserName",
            type: "input",
            label: "填写人：",
            required: true,
        },
        {
            name: "applyDate",
            type: "date",
            label: "填写日期：",
            props: {
                format: "YYYY-MM-DD",
            },
            required: true,
        },
        {
            name: "remarkWork",
            type: "input",
            width: "100%",
            label: "备注说明：",
            props: {
                type: "textarea",
                autosize: { minRows: 4 },
            },
        },
        {
            name: "standSubTable",
            type: "custom",
            width: "100%",
            label: "",
            typeIds: [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], // 开工标准化36-37-38-39-40-41-42-43-44-45-46
        },
    ],
};

const rformItems = function (isVue, projId) {
    const formItemsFiled = projId && `formItems${projId}`;
    if (object[formItemsFiled]) {
        return object[formItemsFiled];
    } else {
        return object[`formItems`];
    }
};

export default rformItems;
